package com.smartalarmclock.Model;

import java.util.Date;

import android.content.Context;

public interface ILogEntry extends IReferencingDataEntity {

	// Enum
	
	public enum PhoneEvent {
		IncomingCall (0),
		SMSMessage (1);
		
		private int m_Value;
		private PhoneEvent(int value) {
			m_Value = value;
		}
		
		public int GetValue() {
			return m_Value;
		}
		
		public static PhoneEvent FromValue(int value) {
			if (value == PhoneEvent.IncomingCall.GetValue()) {
				return PhoneEvent.IncomingCall;
			}
			
			if (value == PhoneEvent.SMSMessage.GetValue()) {
				return PhoneEvent.SMSMessage;
			}
			
			return null;
		}
	}
	
	// Methods
	
	/**
	 * @return the single contact
	 * Note: the single contact can be null if the event was made by a contact
	 * not in the phone contacts or was delete from it.
	 * If so, the contact's name is not null and can be used.
	 */
	public ISingleContact GetSingleContact();
	
	/**
	 * @return the contact's name
	 */
	public String GetContactName(Context context);
	
	/**
	 * @return the timestamp of the log entry
	 */
	public Date GetTimestamp();
	
	/**
	 * @return the phone event (incoming call or SMS)
	 */
	public PhoneEvent GetEvent();
	
	/**
	 * @return whether the call went to the answering machine
	 */
	public boolean DidGoToAnsweringMachine();
	
	/**
	 * @return the SMS message string sent automatically by the Smart Alarm Clock
	 */
	public String GetSentSMSMessageString();
	
	/**
	 * @return the rules item (Profile or VIP) which handled the event.
	 * Note: The handling rules item may be null if it was deleted from the DB.
	 * If so, the rules item's name is not null and can be used.
	 */
	public IRulesItem GetHandlingRulesItem();
	
	/**
	 * @return the rules item (Profile or VIP) which handled the event.
	 */
	public String GetHandlingRulesItemName(Context context);
}
